class MigrateDocumentViewing < ActiveRecord::Migration
  class << self
    def up
      pub_obj = SystemObject.find(:first, :conditions => "name = 'Public'")
      sm = SystemMethod.find(:first, :conditions => ["name = ?","pages/spell"])
      sm.system_object_id = pub_obj.id
      sm.save

      SystemMethod.create(:name => "pages/view_document",:system_object_id => pub_obj.id)
    end

    def down
      SystemMethod.delete_all("name = 'pages/view_document'")
    end
  end
end
